import {PageData, PageProps, ComponentData} from './editor'
import {ActionPayload} from './index'

export interface RespData<T = {}>{
    errno: number;
    data: T;
    message?: string;
    payload?: ActionPayload;
}

export interface ListData<T>{
    list: T[];
    count: number;
}

//后端编辑页面的数据返回结构体
export interface WorkData extends Omit<PageData, 'props'> {
    content: {
         components: ComponentData[];
         props?: PageProps;
    };

}

// 截图上传返回结构体
export interface UploadData{
    urls: string[];
}

export type RespListData<T> = RespData<ListData<T>>;

export type RespWorkData = RespData<WorkData>;

export type RespUploadData = RespData<UploadData>;